/*
 * @FileName: [MerchantService.java]
 * 
 * @Package com.bcinfo.iccard.service
 * 
 * 
 * Copyright (c) 2011-2015 BCINFO Technology Limited Com.
 * All rights reserved.
 * 
 * This software is the confidential and proprietary
 * information of BCINFO Technology Limited Company
 * ("Confidential Information"). You shall not disclose
 * such Confidential Information and shall use it only
 * in accordance with the terms of the contract agreement
 * you entered into with RKY.
 * 
 * $Rev$
 * $LastChangedDate$
 * $LastChangedBy$
 * 
 * @category ICCARD
 * 
 * @version 1.1
 * 
 * @author $Author$
 * 
 * Change History:[Formatter: author date description] <br/>
 * 1
 * 2
 * 3
 */

package com.bcinfo.iccard.service;

import java.util.List;

import com.bcinfo.iccard.exception.IccardDatabaseException;
import com.bcinfo.iccard.exception.InvalidParametersException;
import com.bcinfo.iccard.exception.MerchantEncodeHasBandByOtherException;
import com.bcinfo.iccard.model.CheckReason;
import com.bcinfo.iccard.model.Merchant;
import com.bcinfo.iccard.service.impl.MerchantNameIsExistException;
import com.bcinfo.iccard.util.PaginationList;

/**
 * 商家信息获取接口<br/>
 * <p>
 * Description:<br/>
 * <p>
 * 商家增删改查
 * 
 * <p>
 * For Examples <br/>
 * 
 * <PRE>
 *      TODO 代码使用示例
 * </PRE>
 * <p>
 */
public interface MerchantService
{

    /**
     * 
     * 按商家名称和编码模糊查询<br/>
     * <p>
     * Description: 用于界面上的自动完成搜索框 <br/>
     * <p>
     * Author: arming<br/>
     * <p>
     * Date: 2013年11月28日-上午10:48:35<br/>
     * <p>
     * 
     * @param keyword
     *            商家名称 或 商家编号
     * @param maxRows
     *            最大行数
     * @return 商家列表
     * 
     */
    public List<Merchant> findByNameCode(String keyword, int maxRows);

    /**
     * 
     * 按照商家编号、状态、业务类型、接入起止时间进行查询 <br/>
     * <p>
     * Description: TODO(详细描述) <br/>
     * <p>
     * Author: xug<br/>
     * <p>
     * Date: 2013-12-5-上午10:31:27<br/>
     * <p>
     * 
     * @param merchantCode
     *            商家编号
     * @param status
     *            状态
     * @param merchantType
     *            业务类型
     * @param beginTime
     *            开始时间
     * @param endTime
     *            结束时间
     * @param pageSize
     * @param pageNo
     * @return 商家列表
     * 
     */
    PaginationList<Merchant> merchantList(String merchantCode, int merchantCheckStatus, int merchantType,
            String beginTime, String endTime, int pageSize, int pageNo);

    /**
     * 获取所有商家信息 <br/>
     * <p>
     * Description: 获取所有商家信息 <br/>
     * <p>
     * Author: arming<br/>
     * <p>
     * Date: 2013年12月10日-上午9:50:45<br/>
     * <p>
     * 
     * @return 商家列表
     * 
     */
    public List<Merchant> findAll();
    
    /**
     * 
     * 新增商家 <br/>
     * <p>Description: TODO(新增商家) 
     * <br/>
     * <p>Author: xug<br/>
     * <p>Date: 2013-12-11-下午06:29:38<br/>
     * <p>
     * @param merchant
     * @return   
     *
     */
    public int add(Merchant merchant) throws MerchantEncodeHasBandByOtherException, IccardDatabaseException,MerchantNameIsExistException;

    
    public int update(Merchant merchant) throws MerchantEncodeHasBandByOtherException, IccardDatabaseException,InvalidParametersException,MerchantNameIsExistException;
    
    /**
     * 
     * 加载商家信息 <br/>
     * <p>Description: TODO(详细描述) 
     * <br/>
     * <p>Author: xug<br/>
     * <p>Date: 2013-12-20-上午11:19:17<br/>
     * <p>
     * @param merchantId
     * @return
     * @throws IccardDatabaseException   
     *
     */
    
    public Merchant load(long merchantId) throws IccardDatabaseException;
    /**
     * 
     * 加载商家审核信息 <br/>
     * <p>Description: TODO(详细描述) 
     * <br/>
     * <p>Author: xug<br/>
     * <p>Date: 2013-12-28-上午09:11:42<br/>
     * <p>
     * @param merchantId
     * @return
     * @throws IccardDatabaseException   
     *
     */
    public Merchant loadAuditInfo(long merchantId) throws IccardDatabaseException;
    /**
     * 
     * 审核 <br/>
     * <p>Description: TODO(详细描述) 
     * <br/>
     * <p>Author: xug<br/>
     * <p>Date: 2013-12-16-上午10:56:50<br/>
     * <p>
     * @param merchantId
     * @param status
     * @param msg
     * @param opId
     * @return
     * @throws IccardDatabaseException   
     *
     */
    int audit(long merchantId, int status, String msg, long opId) throws IccardDatabaseException;
    
    /**
     * 
     * 冻结/解冻 <br/>
     * <p>Description: TODO(详细描述) 
     * <br/>
     * <p>Author: xug<br/>
     * <p>Date: 2013-12-18-下午08:45:27<br/>
     * <p>
     * @param merchantId
     * @param merchantStatus
     * @return
     * @throws IccardDatabaseException
     * @throws InvalidParametersException   
     *
     */
    boolean setStatus(Long merchantId,int merchantStatus) throws IccardDatabaseException,InvalidParametersException;
    
    /**
     * 
     * 获取商家审核信息 <br/>
     * <p>Description: TODO(详细描述) 
     * <br/>
     * <p>Author: xug<br/>
     * <p>Date: 2013-12-20-上午11:15:45<br/>
     * <p>
     * @param merchantId
     * @return
     * @throws IccardDatabaseException   
     *
     */
    CheckReason loadRecentlyCheckReason(long merchantId) throws IccardDatabaseException;
    
    int delete(long merchantId) throws IccardDatabaseException;
    
    int checkMerchantName(String merchantName) throws IccardDatabaseException;
    
    int checkMerchantEncode(String merchantEncode) throws IccardDatabaseException;
}
